package mspbots.cw.business.core.users;

import org.springframework.data.r2dbc.repository.R2dbcRepository;
import reactor.core.publisher.Mono;

/**
 * @author Jay.Yang
 */
public interface UsersRepository extends R2dbcRepository<Users, Long> {

    /**
     * find entity other id and tenant id
     *
     * @param cwUid      cwUid
     * @param tenantCode tenantCode
     * @return account entity
     */
    Mono<Users> findByCwUidAndTenantCode(Long cwUid, Long tenantCode);

    /**
     * find entity other id and tenant id
     *
     * @param identifier identifier
     * @param tenantCode tenantCode
     * @return account entity
     */
    Mono<Users> findByIdentifierAndTenantCode(String identifier, Long tenantCode);
}
